﻿using GDGeek;
using MrPP.Myth;
using System;
using UnityEngine;

namespace MrPP.SerriedCabinet
{
    public class CheckWindow : MonoBehaviour
    {
        [SerializeField]
        MrPP.Helper.MrPPBillboard _board;
        [SerializeField]
        MrPP.Helper.MrPPSimpleTagalong _tagalong;
        public void hide()
        {
            this.gameObject.SetActive(false);
            Follower follower = this.gameObject.AskComponent<Follower>();
            follower.enabled = false;
        }

        public void show(uint next)
        {
         //   Controller controller = this.gameObject.AskComponent<Controller>();
            Follower follower = this.gameObject.AskComponent<Follower>();
            follower.enabled = true;
            if (next == Hero.Instance.id)
            {
                follower.controler = true;
                _board.enabled = true;
                _tagalong.enabled = true;
            }
            else {
                follower.controler = false;
                _board.enabled = false;
                _tagalong.enabled = false;
            }
            this.gameObject.SetActive(true);
        }
    }
}